package uk.co.q3c.deplan.client.admin;

import java.io.Serializable;

import javax.persistence.Id;

import uk.co.q3c.deplan.client.domain.AbstractDomainObject;
import uk.co.q3c.deplan.client.domain.DomainKind;
import uk.co.q3c.deplan.client.domain.DomainObject;
import uk.co.q3c.deplan.client.domain.resource.PersistenceReferenceException;

import com.googlecode.objectify.Key;

public class ChangeLogEntry extends AbstractDomainObject implements Serializable, AdminObject, Comparable<ChangeLogEntry> {

	private static final long serialVersionUID = -3748014125474082388L;
	private String entry;
	@Id
	private Long keyId;
	private int id;

	public ChangeLogEntry(int id, String entry) {
		this.id = id;
		this.entry = entry;
	}

	public ChangeLogEntry() {
	}

	public void setEntry(String entry) {
		this.entry = entry;
	}

	public void setId(int id) {
		this.id = id;
	}

	public int getId() {
		return id;
	}

	public String getEntry() {
		return entry;
	}

	@Override
	public int compareTo(ChangeLogEntry other) {
		return other.getId() - this.getId();
	}

	@Override
	public DomainKind getKind() {
		return DomainKind.ChangeLogEntry;
	}

	public Long getKeyId() {
		return keyId;
	}

	@Override
	public Key<? extends DomainObject> getKey() throws PersistenceReferenceException {
		throw new RuntimeException("Not yet implemented");
	}

	@Override
	public void setKeyId(Long keyId) {
		throw new RuntimeException("Not yet implemented");
	}
}
